#include<iostream>
#include"httplib.h"

int main(){
    using namespace httplib;
    Client cli("0.0.0.0",8081);//初始化client对象
    //定义文件信息
    struct MultipartFormData item;
    //填充item字段
    item.name="file";
    item.content = "hello world";
    item.filename="httplib.txt";
    item.content_type = "text/plain";

    //using MultipartFormDataItems = std::vector<MultipartFormData>;
    MultipartFormDataItems items;//items是一个数组，元素是MultipartFormData
    items.push_back(item);
    //发送数据给服务器
    auto ret = cli.Post("/multipart",items);
    std::cout<<ret->status<<std::endl;
    std::cout<<ret->body  <<std::endl;


    return 0;
}
